from flask import render_template
# 储存个人用户名与密码的字典
user = {}
# 储存以上所有字典的列表
users = []


# 登录功能
def sign_in(username, password):
    # 尝试登录
    for search in users:
        if search['username'] == username and search['password'] == password:
            result = 'yes'
            return result
    #  登录不成功
    else:
        result = 'no'
        return result


# 注册功能
def sign_up(username, password):
    user['username'] = username
    user['password'] = password
    user['status'] = False
    student_bak = user.copy()
    users.append(student_bak)
    user.clear()
    print(users)